Subject: Editor's draft DLSw spec (5 of 8)

From: "Alan K. Bartky, Manager of Technology" <[email-masked]>
Date: Mon, 11 Jul 94 13:40:27 PDT

----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Content-Lines: 1
X-Sun-Content-Length: 22

Here is part 5 of 8.

----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: dlsw5.txt
X-Sun-Content-Lines: 531
X-Sun-Content-Length: 27475

RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

   Here is an example of a switched SDLC PU 2.0 device as the target station.

      ======                            ___                           ======
      |    |        ---------        __/   \__       ---------        |    |
      |    |      __|  _|_  |__     /   IP    \    __|  _|_  |__      |    |
      ======        |   |   |      <  Network  >     |   |   |        ======
     /______\       ---------       \__     __/      ---------       /______\
      Origin       Origin DLSw         \___/        Target DLSw       Target
      Station        partner                          partner         Station
                                                                      (SDLC)
                   disconnected                    disconnected

                   DLC_RESOLVE_C   CANUREACH_ex
                   ----------->    ----------->    reply if virtual MAC/SAP
                                                   for SDLC station is
                                                   configured, if SDLC
                                                   station responds to
                                     ICANREACH_ex  TEST/XID/SNRM/DISC, etc.
                                     <-----------

                   DLC_XID         CANUREACH_cs    DLC_START_DL    XID
                   ----------->    ----------->    ----------->    ----------->
                   circuit_start                   resolve_pending

                                     ICANREACH_cs    DLC_DL_STARTED           XID
                                     <-----------    <-----------    <-----------
               circuit_established                 circuit_pending
                                   REACH_ACK
                                   ----------->   circuit_established

                                   XIDFRAME        DLC_XID
                                   ----------->    ----------->    respond with
                                                                   XID received
                          DLC_XID        XIDFRAME         DLC_XID  above
                     <-----------    <-----------    <-----------

                   DLC_CONTACTED   CONTACT         DLC_CONTACT     SNRM
                   ----------->    ----------->    ----------->    ----------->
                   connect_pending                contact_pending

                      DLC_CONTACT       CONTACTED    DLC_CONTACTED             UA
                     <-----------    <-----------    <-----------    <-----------
                     connected                        connected

                     DLC_INFOs        IFRAMEs        DLC_INFOs        IFRAMEs
                   <------------>  <------------>  <------------>  <------------>

A.K. Bartky                                                  [Page 38]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

   Here is an example of an SDLC T2.1 device as the target station.  (SDLC T2.1
   origin station would look just like the LAN T2.1 origin station)
      ======                            ___                           ======
      |    |        ---------        __/   \__       ---------        |    |
      |    |      __|  _|_  |__     /   IP    \    __|  _|_  |__      |    |
      ======        |   |   |      <  Network  >     |   |   |        ======
     /______\       ---------       \__     __/      ---------       /______\
      Origin       Origin DLSw         \___/        Target DLSw      Target
      Station        partner                          partner        Station

                   disconnected                    disconnected

                   DLC_RESOLVE_C   CANUREACH_ex
                   ----------->    ----------->    implementers choice
                                                   (virtual MAC/SAP configured,
                                                    check to see if station
                                                    is powered up using
                                     ICANREACH_ex   TEST/XID/DISC, etc.)
                                     <-----------

                   DLC_XID         CANUREACH_cs    DLC_START_DL    null XID
                   ----------->    ----------->    ----------->    ---------->
                   circuit_start                   resolve_pending

                                     ICANREACH_cs    DLC_DL_STARTED           XID
                                     <-----------    <-----------    <-----------
               circuit_established                 circuit_pending
                                   REACH_ACK
                                   ----------->   circuit_established

                                   XIDFRAME        DLC_XID
                                   ----------->    ----------->    respond with
                                                                   XID received
                          DLC_XID        XIDFRAME         DLC_XID  above
                     <-----------    <-----------    <-----------

                      DLC_XIDs       XIDFRAMEs        DLC_XIDs          XIDs
                   <------------>  <------------>  <------------>  <------------>

                   DLC_CONTACTED   CONTACT         DLC_CONTACT     SABME
                   ----------->    ----------->    ----------->    ----------->
                   connect_pending                 contact_pending

                      DLC_CONTACT       CONTACTED    DLC_CONTACTED             UA
                     <-----------    <-----------    <-----------    <-----------
                     connected                        connected

                     DLC_INFOs        IFRAMEs        DLC_INFOs        IFRAMEs
                   <------------>  <------------>  <------------>  <------------>

A.K. Bartky                                                  [Page 39]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

4.1.2. Link Restart Protocols

   The following figure depicts the protocol flows that result from restarting the
   end-to-end connection.  This causes the Data Link Switches to terminate the
   existing connection and to enter the Circuit Established state awaiting the
   start of a new connection.

     Data Link   Data Link                     Data Link   Data Link
      Control     Switch                        Switch      Control
     ---------------------                     ---------------------
          +-----------+                             +-----------+
          | Connected |                             | Connected |
    SABME +-----------+                             +-----------+
   ----------->                 RESTART_DL
      DM           ------------------------------------->     DISC
   <-----------                                               -------->
                                                               UA
                         DL_RESTARTED (Case 1)              <--------
                   <-------------------------------------
          +-----------+                             +-----------+
          |Circuit Est|                             |Circuit Est|
          +-----------+                             +-----------+
                        ........... or ...........
    SABME
   ----------->           DL_RESTARTED (Case 2)
       UA          <-------------------------------------
   <-----------                                     +-----------+
                                                    |Circuit Est|
                                CONTACT             +-----------+
      RNR           ------------------------------------>
   <----------

             Figure 5.  DLS Link Restart Message Protocols

   Upon receipt of a SABME command from the origin station, the origin DLS will
   send a RESTART_DL message to the target DLS.  A DM response is also returned to
   the origin station and the data link is restarted.

   Upon receipt of the RESTART_DL message, the target DLS will issue a DISC
   command to the target station.  The target station is expected to return a UA
   response.  The target DLS will then restart its data link and send an
   DL_RESTARTED message back to the origin DLS.  During this exchange of messages,
   both Data Link Switches change states from Connected state to Circuit
   Established state.

   If the origin station now resends the SABME command, the origin DLS will send a
   CONTACT message to the target DLS.  If the SABME command is received prior to
   the receipt of the DL_RESTARTED message (case 2 in the figure), the CONNECT

A.K. Bartky                                                  [Page 40]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

   message is delayed until the DL_RESTARTED message is received.  The resulting
   protocol flows at this point parallel those given above for the connect
   sequence.

4.1.3. Disconnect Protocols

   The following figure depicts the protocol flows that result from the end system
   terminating an existing connection.  Not only is the connection terminated, but
   the circuit between the Data Link Switches is taken down.

     Data Link  Data Link                      Data Link  Data Link
      Control    Switch                         Switch     Control
     --------------------                      --------------------
          +-----------+                             +-----------+
          | Connected |                             | Connected |
          +-----------+                             +-----------+
      DISC
   ---------->                  HALT_DL
       UA         ------------------------------------->      DISC
   <----------                                              --------->
                                                               UA
                               DL_HALTED                    <--------
                  <-------------------------------------
          +-----------+                             +-----------+
          |Disconnectd|                             |Disconnectd|
          +-----------+                             +-----------+

                          ......... or ..........

          +-----------+                             +-----------+
          | Connected |                             | Connected |
          +-----------+                             +-----------+
       DISC              TCP Connection Failure               DISC
   <--------     <------------------------------------>    --------->
        UA                                                     UA
    -------->                                               <--------
          +-----------+                             +-----------+
          |Disconnectd|                             |Disconnectd|
          +-----------+                             +-----------+

              Figure 6.  DLS Disconnect Message Protocols

   Upon receipt of a DISC command from the origin station, the origin DLS will
   reply with a UA response and issue a HALT_DL message to the target DLS.  Upon
   receipt of the HALT_DL message, the target DLS will send a DISC command to the
   target station.  The target station will then respond with a UA response,
   causing the target DLS to return a DL_HALTED message to the origin DLS.  During
   this exchange of messages, both Data Link Switches change states from the
   Connected state to the Disconnected state.

A.K. Bartky                                                  [Page 41]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

   If the TCP connection between two Data Link Switches fails, all connections
   that are currently multiplexed on the failed TCP connection will be taken down.
   This implies that both Data Link Switches will send DISC commands to all the
   local systems that are associated with the failed connections.  Upon sending
   the DISC command, the Data Link Switch will enter the DISCONNECT state for each
   circuit.

4.2. DLS State Machine

   The following state tables describe the states for a single connection through
   the Data Link Switch.  State information is kept for each connection.  The
   initial state for a connection is DISCONNECT.  The steady state is either
   CIRCUIT_ESTABLISHED or CONNECTED.  In the former state, an end-to-end circuit
   has been established allowing the support of Type 1 LLC between the end
   systems.  The latter state exists when an end-to-end connection has been
   established for the support of Type 2 LLC services between the end systems.

   For SNA, circuit establishment is via the use of IEEE 802.2 Test or XID
   frames.  SNA devices send these frames to the null SAP in order to determine
   the source route information in support of bridging. Normally SNA devices use
   SAP x'04', x'08', or x'0C' (most SNA LLC2 that have a single PU per MAC address
   use a default of x'04').  Typically the SAP would be used to determine if the
   Test frames should be sent to the DLSw code in the router.  If either the DSAP
   or the SSAP field is uses a SAP address of x'04', x''08', or x'0C' it can be
   usually assumed that the end station is attempting to establish an SNA LLC2
   connection ( this is true even for devices such as SDLC to LLC2 converters that
   use multiple local SAPs to establish multiple connections to a remote host MAC
   address using the typical default range ).  If both bridging and DLSw are
   enabled, this allows the product to ensure that SNA frames are not both bridged
   and switched.

   For NetBIOS, circuit establishment is via the Name Query and Name Recognized
   frames.  These frames are used for both address resolution and source route
   determination.  Normally NetBIOS devices use SAP x'F0'.

4.2.1. Data Link Switch States

   The Switch-to-Switch Protocols will be formally defined through a single state
   machine.  The following table lists the eleven possible states.  A separate
   state machine is employed for each end-to-end circuit that is maintained by the
   Data Link Switch.  The three steady states are DISCONNECTED,
   CIRCUIT_ESTABLISHED, and CONNECTED.

A.K. Bartky                                                  [Page 42]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

     State Name            Description
     ----------            -----------
     CIRCUIT_ESTABLISHED   The end-to-end circuit has been
                           established.  At this time LLC Type 1
                           services are available from end-to-end.
     CIRCUIT_PENDING       The target DLS is awaiting a REACH_ACK
                           response to an ICANREACH message.
     CIRCUIT_RESTART       The DLS that originated the reset is
                           awaiting the restart of the data link
                           and the DL_RESTARTED response to a
                           RESTART_DL message.
   3 CIRCUIT_START         The origin DLS is awaiting a ICANREACH_cs in
   3                       response to a CANUREACH_cs message.
     CONNECTED             The end-to-end connection has been
                           established thereby allowing LLC Type 2
                           services from end-to-end in addition to
                           LLC Type 1 services.
     CONNECT_PENDING       The origin DLS is awaiting the CONTACTED
                           response to a CONTACT message.
     CONTACT_PENDING       The target DLS is awaiting the
                           DLC_CONTACTED confirmation to a DLC_CONTACT
                           signal (i.e., DLC is waiting for a UA
                           response to an SABME command).
     DISCONNECTED          The initial state with no circuit or
                           connection established, the DLS is awaiting
                           either a CANUREACH, an ICANREACH, a
                           NETBIOS_NQ, or a NETBIOS_NR message.
     DISCONNECT_PENDING    The DLS that originated the disconnect
                           is awaiting the DL_HALTED response to a
                           HALT_DL message.
     HALT_PENDING          The remote DLS is awaiting the DLC_DL_HALTED
                           indication following the DLC_HALT_DL request
                           (i.e., DLC is waiting for a UA response to a
   1                       DISC command), due to receiving a HALT_DL
   1                       message.
   1 HALT_PENDING_NOACK    The remote DLS is awaiting the DLC_DL_HALTED
   1                       indication following the DLC_HALT_DL request
   1                       (i.e., DLC is waiting for a UA response to a
   1                       DISC command), due to receiving a
   1                       HALT_DL_NOACK message.

A.K. Bartky                                                  [Page 43]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

     RESTART_PENDING       The remote DLS is awaiting the DLC_DL_HALTED
                           indication following the DLC_HALT_DL request
                           (i.e., DLC is waiting for a UA response to a
                           DISC command), and the restart of the data
                           link.
     RESOLVE_PENDING       The target DLS is awaiting either the
                           DLC_DL_STARTED indication following the
                           DLC_START_DL request (i.e., DLC is waiting
                           for a Test response as a result of sending a
                           Test command), or a NB_Name_Recognized
                           frame in response to a NB_Name_Query frame.

                   Table 2.  Data Link Switch States

   The DISCONNECT state is the initial state for a new circuit.  One end station
   starts the connection via a TEST or XID command (i.e., DLC_RESOLVE_C) or a
   NetBIOS Name Query command (not explicitly shown).  Upon receipt, the Data Link
   Switches exchange a set of CANUREACH_ex, CANUREACH_cs, ICANREACH and REACH_ACK
   messages.  Upon completion of this four-legged exchange (note this was a
   "three-legged exchange" in RFC 1434), both Data Link Switches will be in the
   CIRCUIT_ESTABLISHED state.  Two pending states also exist during this exchange.
   The RESOLVE_PENDING state is entered by the target Data Link Switch awaiting a
   Test response to a Test Command and the CIRCUIT_PENDING state is entered by the
   target DLS awaiting the REACH_ACK reply to an ICANREACH message.

   The CIRCUIT_ESTABLISHED state allows for the exchange of LLC Type 1 frames such
   as the XID exchanges between SNA stations that occurs prior to the
   establishment of a connection.  Also, datagram traffic (i.e., UI frames)  may
   be sent and received between the end stations. These exchanges use the XIDFRAME
   and DGRMFRAME messages sent between the Data Link Switches.

   In the CIRCUIT_ESTABLISHED state, the receipt of a SABME command (i.e.,
   DLC_CONTACTED) causes the origin DLS to issue a CONTACT message, to send an RNR
   supervisory frame (i.e., DLC_ENTER_BUSY) to the origin station, and to enter
   the CONNECT_PENDING state awaiting a CONTACTED message.  The target DLS, upon
   the receipt of a CONTACT message, will issue a SABME command (i.e.,
   DLC_CONTACT) and enter the Contact Pending state.  Once the UA response is
   received (i.e., DLC_CONTACTED), the target DLS sends a CONTACTED message and
   enters the CONNECTED state.  When received, the origin DLS enters the Connected
   state and sends an RR supervisory frame (i.e., DLC_EXIT_BUSY).

   The CONNECTED state is the steady state for normal data flow once a connection
   has been established.  Information frames (i.e., INFOFRAME messages) are simply
   sent back and forth between the end points of the connection.  This is the path
   that should be optimized for performance.

   The connection is terminated upon the receipt of a DISC frame or under some
   other error condition detected by DLC (i.e., DLC_ERROR). Upon receipt of this

A.K. Bartky                                                  [Page 44]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

   indication, the DLS will halt the local data link, send a HALT_DL message to
   the remote DLS, and enter the DISCONNECT_PENDING State.  When the HALT_DL frame
   is received by the other DLS, the local DLC is halted for this data link, a
   DL_HALTED message is returned, and the DISCONNECTED state is entered.  Receipt
   of this DL_HALTED message causes the other DLS to also enter the DISCONNECTED
   state.

   The CIRCUIT_RESTART state is entered if one of the Data Link Switches receives
   a SABME command  (i.e., DLC_RESET) while in the CONNECTED state.  This causes a
   DM command to be returned to the origin station and a RESTART_DL message to be
   sent to the remote Data Link Switch. This causes the remote data link to be
   halted and then restarted.  The remote DLS will then send a DL_RESTARTED
   message back to the first DLS.  The receipt of the DL_RESTARTED message causes
   the first DLS to issue a new CONTACT message, assuming that the local DLC has
   been contacted (i.e., the origin station has resent the SABME command).  This
   is eventually responded to by a CONTACTED message.  Following this exchange,
   both Data Link Switches will return to the CONNECTED state.  If the local DLC
   has not been contacted, the receipt of a DL_RESTARTED command causes the Data
   Link Switch to enter the CIRCUIT_ESTABLISHED state awaiting the receipt of a
   SABME command (i.e., DLC_CONTACTED signal).

   The HALT_PENDING and RESTART_DL states have only one input event and only one
   output action.  While in these states, the Data Link Switch is awaiting
   responses from the local station on the adjacent LAN (i.e., a UA response to a
   DISC command). Also in the RESTART_PENDING state, the Data Link Switch will
   attempt to restart the data link prior to sending a DL_RESTARTED message.  For
   some implementations, the start of a data link involves the exchange of a Test
   command/response on the adjacent LAN (i.e., DLC_START_DL).  For other
   implementations, this additional exchange may not be required.

4.2.2. State Transition Tables

   This section provides a detail representation of the Data Link Switch, as
   document by a set of state machines.  The first state machine documents the
   sending and receiving of SSP messages.  Many of the transitions are dependent
   upon local signals between the Data Link Switch entity and one of the DLC
   entities.  These signals and their definitions are given in the following
   tables.

     Event Name      Description
     ----------      -----------
     DLC_CONTACTED   Contact Indication:  DLC has received an SABME
   3                 command or DLC has received a UA response as a
                     result of sending an SABME command.

A.K. Bartky                                                  [Page 45]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

     DLC_DGRM        Datagram Indication:  DLC has received a UI frame.
     DLC_ERROR       Error condition indicated by DLC:  Such a
                     condition occurs when a DISC command is received
                     or when DLC experiences an unrecoverable error.
     DLC_INFO        Information Indication:  DLC has received an
                     Information (I) frame.
     DLC_DL_HALTED   Data Link Halted Indication:  DLC has
                     received a UA response to a DISC command.
     DLC_DL_STARTED  Data Link Started Indication:  DLC has
                     received a Test response from the null SAP.
     DLC_RESET       Reset Indication:  DLC has received an SABME
                     command during the time a connection is
                     currently active and has responded with DM.
     DLC_RESOLVE_C   Resolve Command Indication:  DLC has received
                     a Test command addressed to the null SAP, or an
                     XID command addressed to the null SAP.
     DLC_XID         XID Indication:  DLC has received an XID command
                     or response to a non-null SAP.

   3 Other Events:
   3
   3    Event Name      Description
   3    ----------      -----------
   3    XPORT_FAILURE   Failure of the transport connection used by the
   3                    circuit.
   3    CS_TIMER_EXP    The CIRCUIT_START timer (started when the circuit
   3                    went into CIRCUIT_START state) has expired.

A.K. Bartky                                                  [Page 46]RFC XXXX      DLSw: Switch-to-Switch Protocol                June 1994

                       Table 3.  Local DLC Events

     Action Name     Description
     -----------     -----------
     DLC_CONTACT     Contact Station Request:  DLC will send a SABME
   3                 command of a UA response to an outstanding SABME
   3                 command.
     DLC_DGRM        Datagram Request:  DLC will send a UI frame.
     DLC_ENTER_BUSY  Enter Link Station Busy:  DLC will send an
                     RNR supervisory frame.
     DLC_EXIT_BUSY   Exit Link Station Busy:  DLC will send an RR
                     supervisory frame.
     DLC_HALT_DL     Halt Data Link Request:  DLC will send a DISC
                     command.
     DLC_INFO        Information Request:  DLC will send an I frame.
     DLC_RESOLVE_R   Resolve Response Request:  DLC will send a
                     Test response or XID response from the null SAP.
     DLC_START_DL    Start Data Link Request:  DLC will send a Test
                     command to the null SAP.
     DLC_XID         XID Request:  DLC will send an XID command or an
                     XID response.

   3 Other Actions:
   3
   3 Action Name     Description
   3 ----------      -----------
   3 START_CS_TIMER  Start the CIRCUIT_START timer.

                         Table 4.  Local DLC Actions

   The Data Link Switch may be described by a state transition table as documented
   in the following sections.  Each of the states is described below in terms of
   the events, actions, and next state for each transition. If a particular event
   is not listed for a given state, no action and no state transition should occur
   for that event.  Any significant comments concerning the transitions within a
   given state are given immediately following the table representing the state.

   A separate state machine is maintained by the Data Link Switch for each end-to-
   end circuit.  The number of circuits that may be supported by each Data Link
   Switch is a local implementation option.

A.K. Bartky                                                  [Page 47]